package cn.springbook.common.core.enums;

import cn.springbook.common.core.domain.BaseEnum;

/**
 * <p>
 * 返回JSON响应状态
 * </p>
 *
 * @author: caifenglin
 * @date: 2021/6/24 20:03
 */
public enum ResultEnum implements BaseEnum<Integer> {

    /**
     * 成功
     */
    SUCCESS(200, "操作成功"),

    /**
     * 失败
     */
    FAIL(400, "操作失败"),

    /**
     * 接口不存在
     */
    NOT_FOUND(404, "请求不存在"),

    /**
     * 服务器内部错误
     */
    INTERNAL_SERVER_ERROR(500, "服务器内部错误");

    private int code;

    private String message;

    ResultEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return this.code;
    }

    public String getMessage() {
        return this.message;
    }

    @Override
    public Integer getValue() {
        return this.code;
    }
}
